import { $post, $get } from '@js/request'
import { compress, decompress } from '@src/assets/js/tool'

export async function submitRequest (name, license, fileid, fileid1) {
  const res = await $post('/api/xd/certify', {
    name,
    license_type: '身份证',
    license: compress(license),
    fileid,
    fileid1,
    status: 1
  })
  return res.data
}

export async function getIdentityInfoRequest() {
  const res = await $get('/api/common/certify/getByUid');
  if (res.data && typeof res.data.license === 'string') {
    res.data.license = decompress(res.data.license)
  }
  return res.data;
}